package light.head.model;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.hibernate.annotations.Formula;

/**
 *	园区招聘信息
 */
@Entity
@Table
public class ParkRecruit implements Serializable{
	private static final long serialVersionUID = -308952623086862556L;
	private Integer code;				// 流水号
	private Integer oc;					// 公司编号
	private Integer rc;					// 招聘编号
	private String post;				// 招聘职位
	private String name;				// 公司名称
	private Integer sort;				// 排序
	private Integer cu;					// 创建人
	private Date ct;					// 创建时间
	private Byte status = 0;			// 是否通过验证 (0.未审核 1.审核通过 2.审核未通过)
	private boolean deleted;			// 是否删除
	private List<ParkRecruit> list;		// 批量添加
	
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column
	public Integer getCode() {
		return code;
	}
	@Column
	public Integer getOc() {
		return oc;
	}
	@Column
	public Integer getRc() {
		return rc;
	}
	@Formula("(SELECT ri.post FROM RecruitInfo ri WHERE ri.code = rc )")
	public String getPost() {
		return post;
	}
	@Formula("(SELECT o.name FROM  Organ o WHERE o.code = oc )")
	public String getName() {
		return name;
	}
	@Column
	public Integer getSort() {
		return sort;
	}
	@Column
	public Integer getCu() {
		return cu;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column(updatable = false, nullable = false)
	public Date getCt() {
		return ct;
	}
	@Column
	public boolean isDeleted() {
		return deleted;
	}
	@Column
	public Byte getStatus() {
		return status;
	}
	@Transient
	public List<ParkRecruit> getList() {
		return list;
	}
	public void setCode(Integer code) {
		this.code = code;
	}
	public void setOc(Integer oc) {
		this.oc = oc;
	}
	public void setRc(Integer rc) {
		this.rc = rc;
	}
	public void setPost(String post) {
		this.post = post;
	}
	public void setName(String name) {
		this.name = name;
	}
	public void setSort(Integer sort) {
		this.sort = sort;
	}
	public void setCu(Integer cu) {
		this.cu = cu;
	}
	public void setCt(Date ct) {
		this.ct = ct;
	}
	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}
	public void setStatus(Byte status) {
		this.status = status;
	}
	public void setList(List<ParkRecruit> list) {
		this.list = list;
	}
	
}
